package edu.sctu.practice.class02.xuejiahua.assign02;

/**
 * Created by Administrator on 2015/10/8.
 */
public class Rational {
    public double a;
    public double b;
    public double c;// a/b的值ֵ


    public Rational(double a ,double b ) {
        this.a = a;
        this.b = b;
    }
    public double getAdd(){
        return (a+b);

    }
    public double getMinus(){
        return (a-b);

    }
    public double getTime(){
        return (a*b);

    }
    public double getDivide(){
        if(b!=0){
            c=a/b;
        }else {
            System.out.println("输入错误b不能为0");

        }
       return c;
    }


}
